import { Component, ViewChild,Inject,forwardRef,Input,Output,EventEmitter} from '@angular/core';
import { CTAFComponent,ComponentBase,ChangeDetectorRef} from '@ctaf/framework';
import { ForeignExchangeComponent } from '.././foreignExchange.component';
@CTAFComponent({
    selector: 'qdm-foreignExchangeChild',
    templateUrl: 'foreignExchangeChild.component.html'
  })
export class ForeignExchangeChildComponent extends ComponentBase{//使用export创建组件的类并暴露出去
    @Inject(forwardRef(()=>ForeignExchangeComponent)) public parent:ForeignExchangeComponent;
    @Input() private msgFromPar: string;//从父组件来的消息
    @Output() private outer = new EventEmitter<string>();//发送给父组件的消息
    fun1(){
      alert("viewChild调用子组件里的fun1方法");
    }
    sendMsgToPar(){
        this.outer.emit('message from child');
    }
}
